# remoteFileManager
File Manager that uses Telegram servers for storing files.
Powered by [pyrogram](https://github.com/pyrogram/pyrogram).
This program has an advanced command-line interface, ability to transfer files
larger than 2G and more!

## Features
* Ability to show downloading and uploading progress (there's a bug that doesn't
allow this at this moment)
* Gets around telegram's 2G file limit by splitting files in chunks
* Intuitive and fast scrolling when selecting uploaded files (directory grouping
available soon)
* Fast downloading and uploading of files
* Ability to upload/download multiple files at once (after 4 simultaneous
transfers there if no speed benefit)
* Cancelling and resuming file transfers
* Files are encrypted before uploading and decrypted after downloading

## Installing requirements
```pip3 install -r requirements.txt -U```

### Or if you want to install them manually:
* Pyrogram (`pip3 install -U pyrogram`)
* TgCrypto (`pip3 install -U tgcrypto`) (Recommended: used by `pyrogram` for
boosting transfer speed)
* Urwid (`pip3 install -U urwid`) (UI library)
* PyInstaller (`pip3 install -U pyinstaller`) (Bundles the scripts into one
executable)

## Installing tgFileManager
* Do `make install` to compile the dependencies and install the program in
`/usr/local/bin` (if you don't have root permissions, give `install_path=<dir>`
argument where `<dir>` is a path you can write to and is in your `$PATH`
variable)
* When you first run `tgFileManager`, you will be asked for your phone number
and confirmation for every session from 1 to `max_sessions` (which by default is
4), there is no **easy** way to automate this, also you will need your own
[app_id and api_hash](https://github.com/BouncyMaster/telegramFileManager#getting-app_id-and-api_hash)

**Warning**: You might get a FloodWait exception when doing this, if you get
that you need to force close the program, wait for the time specified, then run
the program again.

## Running tgFileManager
### Most of these keybinds can be changed by editing ~/.config/tgFileManager.ini
* Uploading: pressing `u` will prompt you for the file path and what you want
it's path to be in the database.
* Downloading: pressing `d` will show you the list of files you have uploaded
and their total size.
* Cancelling: selecting the transfer you want to cancel then pressing `c`
will soft cancel the transfer (will wait current chunk to finish transferring
then will exit, this doesn't work with single chunk transfers)
* Resuming: this will run at the start or the program or you can run it with `r`
to handle cancelled transfers, also shows transfers cancelled by the program
quitting abnormally
* Quitting: press `Esc`

## Getting app_id and api_hash
* Log in to your [Telegram core](https://my.telegram.org)
* Go to 'API development tools' and fill out the form
* You will get the api_id and api_hash parameters required for user
authorization
* Enter your api_id and api_hash in your config file
